package com.htthorizon.powersupply.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.htthorizon.powersupply.domain.RealTimePowerOutage;
import com.htthorizon.powersupply.service.RealTimePowerOutageService;
import com.htthorizon.powersupply.mapper.RealTimePowerOutageMapper;
import com.htthorizon.powersupply.vo.RealTimePowerOutageVo;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author Brilliant
* @description 针对表【real_time_power_outage(台区实时停电信息)】的数据库操作Service实现
* @createDate 2025-01-16 23:32:18
*/
@Service
public class RealTimePowerOutageServiceImpl extends ServiceImpl<RealTimePowerOutageMapper, RealTimePowerOutage>
    implements RealTimePowerOutageService{

    @Override
    public List<RealTimePowerOutageVo> getLineOutageStatistics() {
        return baseMapper.getLineOutageStatistics();
    }

    @Override
    public void insertIngoreBatch(List<RealTimePowerOutage> realTimePowerOutages) {
        if (realTimePowerOutages == null ||!realTimePowerOutages.isEmpty()) {
            baseMapper.insertIgnore(realTimePowerOutages);
        }
    }
}




